package demo.ip;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class IPDemo {

	public static void main(String[] args) throws UnknownHostException {
		InetAddress[] iAll = InetAddress.getAllByName("threethousanddream.top");
		for (InetAddress i : iAll) {
			System.out.println("域名：" + i.getHostName());
			System.out.println("IP：" + i.getHostAddress());
			System.out.println();
		}
		System.out.println(new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss").format(new Date()));
	}
}
